package cn.iocoder.yudao.module.trade.controller.app.order.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Schema(description = "用户 App - 交易订单结算信息 Response VO")
@Data
public class AppTradeOrderOrderRespVO {

    @Schema(description = "交易类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") // 对应 TradeOrderTypeEnum 枚举
    private Integer type;

    @Schema(description = "费用", requiredMode = Schema.RequiredMode.REQUIRED)
    private Price price;

    @Schema(description = "用户收件地址", requiredMode = Schema.RequiredMode.REQUIRED)
    private Address memberAddress;

    @Schema(description = "费用（合计）")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class Price {

        @Schema(description = "商品原价（总）", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal totalPrice;
        @Schema(description = "下单克重", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal weight;
        @Schema(description = "折料重量", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal convertWeight;
        @Schema(description = "旧料重量", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal exchangeWeight;
        @Schema(description = "下单时价", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal orderPrice;
        @Schema(description = "定金", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal deposit;
        @Schema(description = "延期费", requiredMode = Schema.RequiredMode.REQUIRED, example = "500")
        private BigDecimal delayPrice;
        @Schema(description = "订单优惠（总）", requiredMode = Schema.RequiredMode.REQUIRED, example = "66")
        private BigDecimal discountPrice;
        @Schema(description = "运费金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
        private BigDecimal deliveryPrice;
        @Schema(description = "工费", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
        private BigDecimal processPrice;
        @Schema(description = "支付金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "450")
        private BigDecimal payPrice;
        @Schema(description = "附加费", requiredMode = Schema.RequiredMode.REQUIRED, example = "450")
        private BigDecimal additionPrice;

    }

    @Schema(description = "地址信息")
    @Data
    @Builder
    public static class Address {

        @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        private Long id;

        @Schema(description = "收件人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王")
        private String name;

        @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
        private String mobile;

        @Schema(description = "地区编号", requiredMode = Schema.RequiredMode.REQUIRED)
        private Integer areaId;
        @Schema(description = "地区名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "上海上海市普陀区")
        private String areaName;

        @Schema(description = "详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "望京悠乐汇 A 座")
        private String detailAddress;

        @Schema(description = "是否默认收件地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
        private Boolean defaultStatus;

        @Schema(description = "地址类型：0-自提 1-寄送", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
        private Integer addressType;

    }

}
